package wondersgroup.androidwidget.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.ContentLoadingProgressBar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import wondersgroup.androidwidget.R;

/**
 * @author 黄赛赛
 * @version V1.0
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}()
 * @date 2016/9/26 13:38
 */
public class ContentLoadingProgressBarFragment extends Fragment {


    @Bind(R.id.btn_show)
    Button btnShow;
    @Bind(R.id.btn_hide)
    Button btnHide;
    @Bind(R.id.content_loading_progressbar)
    ContentLoadingProgressBar contentLoadingProgressbar;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_content_loading_progressbar,
                container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @OnClick({R.id.btn_show, R.id.btn_hide})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_show:
                contentLoadingProgressbar.show();
                break;
            case R.id.btn_hide:
                contentLoadingProgressbar.hide();
                break;
        }
    }
}
